﻿<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title></title>
	<meta charset="utf-8" />
	<link href="../../../dist/css/ud2.css" rel="stylesheet" />
	<link href="../../src/test.css" rel="stylesheet" />
	<script src="../../../vendor/js/jquery.js"></script>
	<script src="../../../dist/js/ud2.js"></script>
</head>
<body>

	<h3>文件上传控件</h3>

	<fieldset>
		<legend>样式</legend>
		<div>
			<h5>标准样式</h5>
			<p>
				<input ud2="file" ud2-file-style="standard" />
			</p>

			<hr class="hr" />

			<h5>自定义样式 (该用例只设置了简单的皮肤样式)</h5>
			<p>
				<input ud2="file" ud2-id="custom" />
				<script>
					ud2.ready(function () {

						var file = ud2.file.collection['custom'];
						var $skin = $([
							'<div class="group" style="width: 100%">',
							'<button class="btn">选择文件</button>',
							'<span class="textbox" />',
							'</div>'
						].join(''));

						file.getContent().css('border', 'none').append($skin);

						file.style.fileAddBtn($skin.find('button')).fileAddFn(function (file) {
							$skin.find('span').html(file.name);
						});
					});
				</script>
			</p>
		</div>
	</fieldset>

</body>
</html>
